package com.dp.vo;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


@Entity
@Table(name = "t_ebook_content")
//@NamedQueries({@NamedQuery(name = "TEbookContent.findAll", query = "SELECT t FROM TEbookContent t"), @NamedQuery(name = "TEbookContent.findByContentid", query = "SELECT t FROM TEbookContent t WHERE t.contentid = :contentid")})
public class TEbookContent implements Serializable{
	private static final long serialVersionUID = 1L;
	@Id
	@Basic(optional = false)
	@Column(name = "contentid")
	private String contentid;                    //内容id
	@Basic(optional = false)
	@Column(name = "bookname")               
	private String bookname;					//内容名称
	@JoinColumn(name = "servicecode", referencedColumnName = "service_code")   
	@ManyToOne
    private TServiceInfo serviceInfo;		    //业务代码
	@Column(name = "bookintro")               
	private String bookintro;					
	@Column(name = "booktag")               
	private String booktag;	
	@JoinColumn(name = "genreid", referencedColumnName = "genre_id")   
	@ManyToOne
	private TGenre genre;                       
	@Column(name = "author")               
	private String author;	
	@Column(name = "language")               
	private String language;	
	@Column(name = "publisher")               
	private String publisher;	
	@Column(name = "copyright")               
	private String copyright;	
	@Column(name = "publishtime")          
	@Temporal(TemporalType.TIMESTAMP)
	private Date publishtime;                 //发布日期  
	@Basic(optional = false)
	@Column(name = "userid")                 
	private String userid;
	@Column(name = "addtime")          
	@Temporal(TemporalType.TIMESTAMP)
	private Date addtime;              
	@Column(name = "lastupdatetime")          
	@Temporal(TemporalType.TIMESTAMP)
	private Date lastupdatetime;   
	@Column(name = "status")               
	private String status;
	@Column(name = "source")               
	private String source;
	@Column(name = "seiralstatus")               
	private Integer seiralstatus;
	@Column(name = "audituser")     
	private String audituser;                      //审核人
	@Column(name = "cause")     
	private String cause;                        //未通过原因
	@Column(name = "markcode")     
	private String markcode;                        //电子书唯一编号
	@Column(name = "charcount")     
	private String charcount;                        //字数
	
	@OneToMany(fetch = FetchType.EAGER,mappedBy = "tebookContent")
    private Set<TEbookSection> tebookSections;   //内容下章节Set
	@JoinColumn(name = "contentid", referencedColumnName = "contentid",insertable = false, updatable = false)
	@ManyToOne
	private NewsContenttitle newsContenttitle;
	
	public TEbookContent(){
	}
    public TEbookContent(String contentid){
		this.contentid=contentid;
	}
	public String getContentid() {
		return contentid;
	}
	public void setContentid(String contentid) {
		this.contentid = contentid;
	}
	public String getBookname() {
		return bookname;
	}
	public void setBookname(String bookname) {
		this.bookname = bookname;
	}
	public TServiceInfo getServiceInfo() {
		return serviceInfo;
	}
	public void setServiceInfo(TServiceInfo serviceInfo) {
		this.serviceInfo = serviceInfo;
	}
	public String getBookintro() {
		return bookintro;
	}
	public void setBookintro(String bookintro) {
		this.bookintro = bookintro;
	}
	public String getBooktag() {
		return booktag;
	}
	public void setBooktag(String booktag) {
		this.booktag = booktag;
	}
	public TGenre getGenre() {
		return genre;
	}
	public void setGenre(TGenre genre) {
		this.genre = genre;
	}
	public String getAuthor() {
		return author;
	}
	public void setAuthor(String author) {
		this.author = author;
	}
	public String getLanguage() {
		return language;
	}
	public void setLanguage(String language) {
		this.language = language;
	}
	public String getPublisher() {
		return publisher;
	}
	public void setPublisher(String publisher) {
		this.publisher = publisher;
	}
	public String getCopyright() {
		return copyright;
	}
	public void setCopyright(String copyright) {
		this.copyright = copyright;
	}
	public Date getPublishtime() {
		return publishtime;
	}
	public void setPublishtime(Date publishtime) {
		this.publishtime = publishtime;
	}
	public String getUserid() {
		return userid;
	}
	public void setUserid(String userid) {
		this.userid = userid;
	}
	public Date getAddtime() {
		return addtime;
	}
	public void setAddtime(Date addtime) {
		this.addtime = addtime;
	}
	public Date getLastupdatetime() {
		return lastupdatetime;
	}
	public void setLastupdatetime(Date lastupdatetime) {
		this.lastupdatetime = lastupdatetime;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public String getSource() {
		return source;
	}
	public void setSource(String source) {
		this.source = source;
	}
	public Integer getSeiralstatus() {
		return seiralstatus;
	}
	public void setSeiralstatus(Integer seiralstatus) {
		this.seiralstatus = seiralstatus;
	}
	public String getAudituser() {
		return audituser;
	}
	public void setAudituser(String audituser) {
		this.audituser = audituser;
	}
	public String getCause() {
		return cause;
	}
	public void setCause(String cause) {
		this.cause = cause;
	}
	public String getMarkcode() {
		return markcode;
	}
	public void setMarkcode(String markcode) {
		this.markcode = markcode;
	}
	public String getCharcount() {
		return charcount;
	}
	public void setCharcount(String charcount) {
		this.charcount = charcount;
	}
	public Set<TEbookSection> getTebookSections() {
		return tebookSections;
	}
	public void setTebookSections(Set<TEbookSection> tebookSections) {
		this.tebookSections = tebookSections;
	}
	public NewsContenttitle getNewsContenttitle() {
		return newsContenttitle;
	}
	public void setNewsContenttitle(NewsContenttitle newsContenttitle) {
		this.newsContenttitle = newsContenttitle;
	}
	@Override
	public int hashCode() {
	        int hash = 0;
	        hash += (contentid != null ? contentid.hashCode() : 0);
	        return hash;
	}

    @Override
	public boolean equals(Object object) {
	    if (!(object instanceof TEbookContent)) {
	          return false;
	     }
	    TEbookContent other = (TEbookContent) object;
	     if ((this.contentid == null && other.contentid != null) || (this.contentid != null && !this.contentid.equals(other.contentid))) {
	         return false;
	     }
	     return true;
	}
	    
	@Override
    public String toString() {
        return "com.dp.vo.TEbookContent[contentid=" + contentid + "]";
    }
}
